package com.dataart.productshop.file.utils;

import com.dataart.productshop.Constants;
import com.dataart.productshop.model.FileInfo;
import com.dataart.productshop.model.Picture;

import java.util.ArrayList;
import java.util.List;

public class PictureUtils {
	public static List<String> getPathes(FileInfo fileInfo, String prefix){
		List<String> fullPathes = new ArrayList<String>();
		String folderName = StringUtils.getFirstExpr(fileInfo.getFilePath(), Constants.GET_DIR_NAME_EXPR);
		for (Picture picture : fileInfo.getPictures()) {
			fullPathes.add(prefix + "/"+ folderName +"/" +picture.getFilePath());
		}
		return fullPathes;
	}
}
